<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript">
function validate(){
	if(form.username.value==""){
		alert("用户名不能为空");	
		return false;
	}
	if(form.nickname.value==""){
		alert("昵称不能为空");	
		return false;
	}
	if(form.password.value==""){
		alert("密码不能为空");	
		return false;
	}
	if(form.password2.value==""){
		alert("确认密码不能为空");	
		return false;
	}
	if(form.password2.value!=form.password.value){
		alert("密码不相同，请重新输入");	
		return false;
	}
}
</script>
<title>注册</title>
</head>
<body>
<form action="register" method="post" onsubmit="return validate()" name="form">
用户名：<input type="text" name="username"><br>
昵称：<input type="text" name="nickname"><br>
密码：<input type="password" name="password"><br>
确认密码：<input type="password" name="password2"><br>
<input type="submit" value="注册">
<input type="button" value="登录" onclick="window.location.href='login.html';">
</form>
</body>
</html>